-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few more fixes for 7.6.4 release. #1759
Conversation
The names and usage of various methods used to navigate graph paths have been substantially refactored for clarity and consistency. Changes span across multiple java classes and involve renaming and modifying the usage of these path methods. Existing method calls were replaced with equivalent but syntactically updated method calls to fit the refactoring changes. While core functionality remains unchanged, code readability has been improved.
Revised the logic used to determine whether nodes in a graph are separated, and modified EdgeNode construct to omit redundant 'sawInArrow' property. This simplification streamlines the EdgeNode construct while preserving functionality, and adjusts various reachability methods to have more direct, readable logic.
Several methods related to checking node separations have been updated to include an additional boolean parameter. This change has been propagated across multiple files. The update also involved commenting out certain lines and modifying relevant unit tests accordingly.
The 'getParents' method now includes an option to allow for selection bias, impacting how undirected edges are interpreted. This changes the conditions for adding nodes as parents in the path-tracing process. This update will notably affect cyclic directed graphs and PAGs.
Added actions to the GUI that allows users to check if a displayed graph is of a certain type (DAG, CPDAG, MPDAG, MAG, PAG) and displays a corresponding message. The graph types are checked using their respective 'isLegal' methods in the GraphWorkbench class.
Extended the functionality of the AlgcomparisonEditor class to accept and handle graphs supplied by the user. Adjusted the dropdown menu in the UI to include the user-supplied graph option when available. Updated the AlgcomparisonModel class to store and manage the user-supplied graph data.
A new import, `edu.cmu.tetrad.search.utils.MeekRules`, was added to the Paths class. This was used to implement Meek rules which aid in orienting edges in the graphical model. The equals_check was adjusted - now it also verifies the maximality by comparing the original graph with the newly oriented one. If both are equal, it returns true; otherwise, it returns false.
Refactored GraphEditor.java and related files to reorganize menu items and enhance graph operations. The main changes include the introduction of "Run Meek Rules" and "Revert to CPDAG" options for more comprehensive graph editing, along with keyboard shortcuts for these options. The refactoring also improved the method for calculating adjustment sets, making it more flexible and efficient. The significant UI enhancements improved the user interaction flow.
The method used for graph transformations, 'cpdagForDag', has been replaced with 'dagToCpdag' across multiple classes. This change is significant in the data models, graph comparison logic and search algorithms, contributing to improved graph-based computations in the system.
The import statement for GraphInPag in Paths.java has been removed as it's unnecessary. The comments/documentation for the method "anteriority" in Paths.java and GraphUtils.java has been improved for clarity, as well as additional documentation added for the methods "getGraphWithoutXToY" and "anteriority" in GraphUtils.java. This should provide a clearer understanding of these methods.
The import statement for GraphInPag in Paths.java has been removed as it's unnecessary. The comments/documentation for the method "anteriority" in Paths.java and GraphUtils.java has been improved for clarity, as well as additional documentation added for the methods "getGraphWithoutXToY" and "anteriority" in GraphUtils.java. This should provide a clearer understanding of these methods.
Renamed adjustment set methods and adjusted their logic in Paths.java and GraphUtils.java, emphasizing visible-edge adjustments. Thorough checks were implemented to ensure that edges exist, are directed, point towards y and are visible. Added exception handling to provide more descriptive error messages if these requirements aren't met. Changes were reflected in the corresponding test cases.
Moved the functionality for probabilistic ancestral graph (PAG) and maximal ancestral graph (MAG) validation from PagColorer to specific CheckGraphForPagAction and CheckGraphForMagAction. Replaced the previous concise alerts with more detailed messaging that includes a reason when a graph is not legal.
The check legal MPDAG disagrees with the check legal CPDAG for a DAG without knowledge (which should not happen). Additionally, It is unclear how to give the check to knowledge when checking for legal MPDAG. Please provide PCALG amat files for testing, I do not know what this format is. Are there unit tests for checking if m-separation is working correctly? User-specified graphs appear to be working great. |
A new submenu "Meek Rules" has been added to the Graph menu across multiple files. It contains menu items "Run Meek Rules" and "Revert To Cpdag". Moreover, an exception handling code block has been added to TestGraphUtils.java to prevent the test from failing in case of any runtime exceptions while calling the 'visibleEdgeAdjustments1' method from GraphUtils.
This update adds the functionality to run final FCI (Fast Causal Inference) rules and checks for Maximal Partially Directed Acyclic Graph (MPDAG) rules on a graph. Also adds undo and reset to original options in the graph workbench for better manipulation of graphs. The code refactors and centralises the conjoint menu insertion and highlight items set-up for a more streamlined code structure.
This commit introduces a new class 'SelectEdgesInCycles' in the 'tetrad-gui' module. This class selects all directed edges in a given display graph presented in the 'GraphWorkbench' workbench. It's mainly used to highlight any cyclic paths within graphs for easier identification.
The xml file is committed to configure Maven for the tetrad-gui module. It includes specifications for plugins, dependencies, and particular configurations like the compiler source and target versions. The addition of this file improves modularity and separates concerns within the project structure.
Improved the handling of graph updates by switching from a while loop to a do-while loop in the `AbstractWorkbench` class. Initialized the `underLineTriples`, `dottedUnderLineTriples`, and `ambiguousTriples` sets in the `KnowledgeGraph` class to empty `HashSet` instances to prevent `NullPointerException`. This change enhances the efficiency of the application's performance.
A few more adjustments.
|
Here are the specs for amat.cpdag and amat.pag. I'll try to figure out a way to put these in the Tetrad documentation somewhere.
|
The TetradLogger instance's log message in the DagToPag class is removed for cleaner code. A new test case (test12) has been added to the TestGraphUtils class. This test generates random graphs and checks whether the "dagToPag" transformation generates proper legal PAGs.
This commit provides comprehensive, descriptive documentation for several methods across multiple classes. It covers useful information about the goal of the methods, their input parameters, return types, and exceptional behavior. The covered classes are mainly related to manipulation and interaction with graph objects.
The method addGraphManipItems has been moved from the GraphEditor class to the GraphUtils class. This change enhances modularization and puts the method in a more appropriate place in the codebase given its functionality. All import and usage references to this method have been updated accordingly.
I believe I am implementing MPDAG as defined in this article:
Definition 4. |
The commit includes the addition of a new method in GraphUtils.java to assess if a bidirected edge has a latent confounder in the true graph. This method throws an IllegalArgumentException if the edge is not bidirected. Furthermore, statistics classes BidirectedLatentPrecision and NumCorrectBidirected have been updated to utilize this method. Search configurations in LvLite.java have also been modified to improve error detection and handling.
This commit adds checks for verbosity before logging messages in the classes FciOrient and LvLite. Now, messages regarding graph edge orientations within the FciOrient class and operations related to unshielded colliders and edge orientations in the LvLite class will only be logged if verbosity is enabled. These changes help to prevent unnecessary logging when verbose mode is not active.
Deleted four Java files related to P1, P2, PagIdea, and PagIdea2 from the tetrad-lib project, as they were no longer necessary. This change simplifies the project structure and removes unneeded functionality.
Enhanced sepset calculation to include node sets Modified SepsetProducer and respective classes to include the functionality of calculating sepsets that contain a given set of nodes. Revised the FciOrient class to adjust the way the Discriminating Path Rule is applied. Also, several class descriptions or comments were corrected for better clarity.
The documentation for the LvLite class has been updated to correctly reflect its purpose. It accurately explains that LvLite is an implementation of the LV algorithm for learning causal structures from observational data, using a combination of independence tests and scores to search for the best graph structure given a data set and parameters.
The documentation for the LvLite class has been updated to correctly reflect its purpose. It accurately explains that LvLite is an implementation of the LV algorithm for learning causal structures from observational data, using a combination of independence tests and scores to search for the best graph structure given a data set and parameters.
Removed the redundant if-else block in the LvLite search algorithm method and simplified it by keeping only the relevant part of the code. Additionally, updated the comments in the LvLite constructor for a clearer understanding, specifying that it will throw NullPointerException if the score is null.
Introduced a new functionality to treat and resolve almost cyclic paths during the graph search process. These are paths that are almost cycles but have a single additional edge that stops them from becoming a cycle. Handlers are placed in different search classes, as well as relevant parameters and documentation updates.
This commit changes the table background color from maroon to blue in the graph_edge_types.html file. This update is part of the user interface enhancement in tetrad-lib module.
Added a function and corresponding boolean flag to resolve almost cyclic paths in the search methods of SvarGfci, SvarFci, LvLite, and Fci. If the flag is set to true, these search methods will check for bidirectional edges and orient them in the direction of any existing directed path.
Several changes were made across multiple classes including changes in abbreviation in NumCorrectVisibleEdges.java, revised search rules in BFci.java, and various modifications in LvLite.java. Notably, a key functionality was added to resolve almost cyclic paths applicable in SvarGfci, SvarFci, LvLite, and Fci algorithms, which when set to true will orient bidirectional edges towards existing directed paths.
The adjacency check in the LvLite class has been simplified by removing redundant condition check. Additionally, the setting of the seed has been removed in both the search method and the parameters list of LvLite in the algorithm/oracle/pag package as it was an unnecessary operation in the current context.
This commit streamlines the edge manipulation flow in LvLite.java by eliminating unnecessary operations and improving condition checks. The changes also adjust how the setDoDiscriminatingPathColliderRule and setDoDiscriminatingPathTailRule methods are invoked in GraspFci.java and GFci.java, now feeding them the doDiscriminatingPathRule value.
In this commit, multiple areas of the code have been updated for better accuracy and readability. The passage of the dependency test into the LvLite class has been removed. Additionally, unnecessary System println calls have been commented out and exceptions now properly print their stack traces. The Discriminating Path Rule method has been introduced and unnecessary iterations in some loops have been eliminated to enhance the code performance.
Refined the LvLite class by removing the unused depth variable and restructuring method descriptions. Method descriptions are now updated to better describe their functionality. The 'discriminatingPathRule' method is now set to private to limit its accessibility.
Several unused import statements were identified and removed from the LvLite.java file. Furthermore, a minor adjustment was made to the comment describing the implementation of the search algorithm.
This commit removes the unused 'distance' variable in the LvLite class and also eliminates the commented-out code associated with it. This clean up helps improve readability and maintainability of the code.
The documentation for the FciOrient class constructor has been updated to indicate that the SepsetProducer object, representing the independence test, only needs to be given if the discriminating path rule is used. Otherwise, it can be null.
Unused code segments related to verbose logging and PAG comparisons have been removed from FciOrient. The printWrongColliderMessage method and truePag related methods have also been eliminated to streamline and declutter the codebase. These changes will not affect the functionality as they involve only unused or debug related code.
Two instances where the algorithm's depth was set have been removed. This change simplifies the algorithm and can potentially optimize its performance, as the depth parameter may not always be necessary or beneficial for certain inputs or situations. This adjustment does not affect the rest of the algorithm configurations.
The LvLite class has had its documentation improved. Both constructors have been expanded to better describe the class's role and functionality. Additionally, the runSearch method documentation has been rewritten and now provides a more accurate description of its operation and exceptions.
Added an extra logging step in the LvLite search algorithm (specifically, in the process of node orientation) in the Tetrad library. This log message will be emitted when the verbose flag is turned on, providing more visibility into the internal operation when debugging.
Added a brief comment to describe the purpose and function of the score-based discriminating path
I added a new experimental algorithm, which is now called LV-Lite. This is an entirely score-based variate of FCI/BFCI. |
The commit refactors the GraphEditor and Paths classes, simplifying code where possible and removing redundant comments and conditions. It simplifies conditions in the Paths class and removes lengthy redundant comments. It also refactors EdgeListGraph class by utilizing computeIfAbsent function for better performance and readability. It corrects a textual error in a comment in the Paths class as well.
The update introduces an enhancement in the reachability algorithm to work more efficiently with CPDAGs and PAGs. The aim is to generate virtual edges directed towards the arrow, enabling the reachability algorithm to find any implied colliders along the path. In addition, minor alterations have been made to the 'TestGraphUtils.java' file to increase the number of random graph generations.
Bryan says I can merge this. :) |
Added a menu to the interface to let the user check whether their graph is of a certain graph type (DAG, CPDAG, MPDAG, MAG, PAG).
Added parsers/renderers in the interface for the amat.cpdag and amat.pag graph matrix types used in PCALG.
Adjusted the m-separation algorithm so that it can correctly infer d-separation facts from CPDAGs without first taking a DAG in the CPDAG.
Added a link from a graph-containing box to Algcomparison in the UI to let the user specify a specific graph for the comparison.